﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BaoJian.Control.local
{
    public partial class DocList : System.Web.UI.UserControl
    {
        public string ColumnID;
        public int Count;
        public string Region;
        public int TitleLength;
        public DataTable Dt;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string sql = "SELECT TOP {0} sid,oid,pid,left(title,{1}) as title ,summary,ctime FROM doc WHERE Region='{2}'AND PID='{3}' AND Recommand != 1 and publish=1 ORDER BY CTime DESC";
                sql = string.Format(sql, Count, TitleLength, Region, ColumnID);
                DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(sql);
                Dt = ds.Tables[0];
            }
        }
    }
}